Use information of the current assignees
Bizagi provides several functions that allow you to find and manipulate information about the current assignees of the current Task. This group of functions all start with the sentence:
Me.Assignees[]
.
note_pin
If you want to get the current assignees of a task after using the assignWorkItem function in the same event (On Enter, On Save, and On Exit), use the method Me.Case.getWorkItem(sTaskName).Assignees
.
When the function is used, an array of users is returned. To use the function, it is necessary to use brackets in order to specify the index of the user. 0 (zero) is the first position of the array.
If there is only one user assigned, the sentence will be Me.Assignees[0].attribute
.
This group of functions are available in Current assignees information category.
The information available about the current assignees is:
Property | Description |
---|---|
Id | Returns a collection containing the id's of all assignees of an activity. |
BossId | Returns a collection containing the Boss of all assignees of an Activity. |
FullName | Returns a collection containing the full name of all assignees of an Activity. |
Location.Name | Returns a collection containing the location of all assignees of an Activity. |
Positions | Returns a collection containing the positions of a specific assignee of an Activity. |
Roles | Returns a collection containing the roles of a specific assignee of an Activity. |
Skills | Returns a collection containing the skills of a specific assignee of an Activity. |
UserName | Returns a collection containing the user name of all assignees of an Activity. |
getUserProperties() | Returns a collection containing a specific user property of all assignees of an Activity. |
Examples
The following examples will illustrate how to use these functions:
- Obtain the Full Name of the current assignees
- Obtain the Roles of the current assignees
- Obtain user properties
Obtain the FullName of the current assignees
The Me.Assignees[].Fullname
function retrieves the full name of all the assignees of an activity.
To use the function, it is necessary to use brackets in order to specify the index of the user. The function has the following syntax:
Me.Assignees[index].FullName
Suppose in a Customer Service Process, you need to obtain the list of users assigned to a specific task. This list will be shown to end users through a collection called AssigneesList.
To build this list, create an expression as an on-enter action in the activity where it is required.
Use the Me.Assignees
function to go through the list of assignees.
For each assignee, create a new record in the AssigneesList collection by using the Me.newCollectionItem
function.
Finally, use the Me.Assignees[].FullName
function to obtain the full name of each assignee and set it as the new record of the collection.
Obtain the Roles of the current assignees
The Me.Assignees[].Roles
function returns a collection containing the roles of a specific assignee of an Activity.
To use the function, it is necessary to use brackets in order to specify the index of the user. The function has the following syntax:
Me.Assignees[index].Roles
Suppose in a Customer Service Process you need to obtain the list of users assigned to a specific task as well as their roles. This list will be shown to end users through a collection called AssigneesList.
To build this list, create an expression as an on-enter action in the activity where it is required.
Use the Me.Assignees
function to go through the list of assignees.
For each assignee, create a new record in the AssigneesList collection by using the Me.newCollectionItem
function. Use Me.Assignees[].FullName
to obtain the full name of each assignee and set it as the new record of the collection.
Now, build a string with the roles of each assignee. Use Me.Assignees[].Roles
to obtain the list of roles.
Go through the list of roles and concatenate their names to obtain a unique string by user.
Finally, use the obtained string as the new value for the Roles column of the new record of the collection. Then reset the string.
Obtain custom user properties
The Me.Assignees[].getUserProperties
function returns a collection containing a user property of a specific assignee of an Activity.
To use the function, it is necessary to use brackets in order to specify the index of the user. The function has the following syntax:
Me.Assignees[index].getUserProperties["Property"]
Suppose in a Customer Service Process you need to obtain the list of users assigned to a specific task as well as a user property called Career. This list will be shown to end users through a collection called AssigneesList.
To build this list, create an expression as an on-enter action in the activity where it is required.
Use the Me.Assignees
function to go through the list of assignees.
For each assignee, create a new record in the AssigneesList collection by using the Me.newCollectionItem
function. Use Me.Assignees[].FullName
to obtain the full name of each assignee and set it as the new record of the collection.
Now obtain the Career property by using the Me.Assignees[].getUserProperties()
and assign this value to the Career column of the new record.
Final result
The list will be shown to end users as below: